<!-- register.html -->
{% extends "base.html" %}

{% block content %}
    <div class="auth-container">
        <h2><i class="fas fa-user-plus"></i> 注册</h2>
        
        {% if error %}
            <div class="info-box status-error" style="margin-bottom: 1.5rem;">
                <i class="fas fa-exclamation-circle"></i> {{ error }}
            </div>
        {% endif %}
        
        <form method="POST" action="{{ url_for('register') }}">
            <div class="form-group">
                <label for="username"><i class="fas fa-user"></i> 用户名</label>
                <input type="text" id="username" name="username" required>
            </div>
            
            <div class="form-group">
                <label for="password"><i class="fas fa-lock"></i> 密码</label>
                <input type="password" id="password" name="password" required>
            </div>
            
            <div class="form-group">
                <label for="role"><i class="fas fa-user-tag"></i> 角色</label>
                <select id="role" name="role" required>
                    <option value="user">普通用户</option>
                    <option value="rescuer">救援人员</option>
                </select>
            </div>
            
            <button type="submit" class="btn" style="width: 100%;">
                <i class="fas fa-user-plus"></i> 注册
            </button>
        </form>
        
        <div class="auth-link">
            已有账号？<a href="{{ url_for('login') }}">立即登录</a>
        </div>
    </div>
{% endblock %}